package com.longtengyuyun;

import java.util.ArrayList;

/**
 * @author ZhaoYunLong
 * @date 2022/3/14
 * @description
 */
public class TestTwo {

    public static void main(String[] args) throws InterruptedException {


//        int i = Runtime.getRuntime().availableProcessors();
//        System.out.println(i);n


        Thread thread = new Thread(() -> {
            System.out.println("1");
        });
        Thread thread1 = new Thread(() -> {
            System.out.println("2");
        });
        Thread thread2 = new Thread(() -> {
            System.out.println(3);
        });

        thread.start();
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        thread1.start();
        thread1.join();
        thread2.start();


//        new ArrayList<>().stream()

//        Thread thread = new Thread(() -> {
//            for (int i = 0; i < 10; i++) {
//                System.out.println("this is one" + i);
//            }
//        });
//
//        Thread threadTwo = new Thread(() -> {
//            for (int i = 0; i < 10; i++) {
//                System.out.println(i);
//            }
//        });
//        thread.start();
//        try {
//            thread.join();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//        threadTwo.start();
    }
}
